package design.graduation.novelsystem.model.domian;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @author: 洪少尉
 * @Date: 2020/4/13 23:41
 * @Description: 
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName(value = "system_admin")
public class Admin implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 姓名
     */
    @TableField(value = "name")
    private String name;

    /**
     * 登陆名
     */
    @TableField(value = "login_name")
    private String loginName;

    /**
     * 密码
     */
    @TableField(value = "password")
    @JsonIgnore
    private String password;

    /**
     * 性别[0:男、1:女]
     */
    @TableField(value = "sex")
    private Integer sex;

    /**
     * 手机号
     */
    @TableField(value = "telephone")
    private String telephone;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 用户类型[0超级管理员1普通管理员]
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 头像图片地址
     */
    @TableField(value = "head_image_path")
    private String headImagePath;

    /**
     * 加密盐
     */
    @TableField(value = "salt")
    @JsonIgnore
    private String salt;

    /**
     * 是否可用
     */
    @TableField(value = "available")
    private Integer available;

    /**
     * 排序码
     */
    @TableField(value = "sort_code")
    private Integer sortCode;

    /**
     * 修改时间
     */
    @TableField(value = "edit_time")
    private Date editTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    private static final long serialVersionUID = 1L;

    public static final String COL_ID = "id";

    public static final String COL_NAME = "name";

    public static final String COL_LOGIN_NAME = "login_name";

    public static final String COL_PASSWORD = "password";

    public static final String COL_SEX = "sex";

    public static final String COL_TELEPHONE = "telephone";

    public static final String COL_REMARK = "remark";

    public static final String COL_TYPE = "type";

    public static final String COL_HEAD_IMAGE_PATH = "head_image_path";

    public static final String COL_SALT = "salt";

    public static final String COL_AVAILABLE = "available";

    public static final String COL_SORT_CODE = "sort_code";

    public static final String COL_EDIT_TIME = "edit_time";

    public static final String COL_CREATE_TIME = "create_time";

    public Admin(Integer id, Date editTime) {
        this.id = id;
        this.editTime = editTime;
    }
}